package com.kisszpy.core.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * 分页模型
 * @author Administrator
 *
 * @param <T>
 */
public class PageModel<T> {
	private List<T> items = new ArrayList<T>();
	private Long total; 		// 总记录数
	private Integer pageNow;    // 当前页
	private Integer pageSize;   // 每页显示记录数
	private Integer pageCount;  // 总页数
	public List<T> getItems() {
		return items;
	}
	public void setItems(List<T> items) {
		this.items = items;
	}
	public Long getTotal() {
		return total;
	}
	public void setTotal(Long total) {
		this.pageCount = (int) ((total+getPageSize()-1)/getPageSize());
		this.total = total;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Integer getPageNow() {
		return pageNow;
	}
	public void setPageNow(Integer pageNow) {
		this.pageNow = pageNow;
	}
	public Integer getPageCount() {
		return pageCount;
	}
}
